﻿using HPIT.RentHouse.DTO;
using HPIT.RentHouse.IService;
using HPIT.RentHouse.Service.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HPIT.RentHouse.Service
{
    public class CityService : ICityService
    {
        public List<CityDTO> GetList()
        {
            RentHouseEntities db = new RentHouseEntities();
            BaseService<T_Cities> baseService = new BaseService<T_Cities>(db);
            List<CityDTO> list = baseService.GetList(a => true).Select(a => new CityDTO()
            {
                Id = a.Id,
                Name = a.Name
            }).ToList();
            return list;
        }
    }
}
